<!doctype html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>城乡计划</title>
    <link th:insert="common/head :: commonheader">
</head>
<!--<body class="login-body">-->

<body style="background-color: #F5F6FA">
    <div class="container">

        <div class="row clearfix">
            <div class="col-md-12 column">
                <div th:insert="common/head :: header">

                </div>
                <div class="jumbotron" style="background-color: #fff; padding-top: 20px; padding-bottom: 10px; margin-bottom: 5px; border: 1px solid #eeeeee;">


                    <div class="container">
                        <div class="row clearfix">
                            <div class="col-md-12 column" style="border: 1px #eeeeee solid;">
                                <ul class="nav nav-pills">
                                    <li class="disabled">
                                        <a href="#">工种</a>
                                    </li>
                                    <li>
                                        <a th:href="@{/queryAllEmployeeWork/}">全部分类</a>
                                    </li>
                                    <!--对请求内容进行拼接，w代表工种， s代表详细工作分类， p代表省份， c代表城市 通过对标签的选择来筛选出想要的招工信息-->
                                    <!--比如 想要筛选工种为服务业/临时工/兼职，地区为广东广州的工作 则会拼接出/01w-05s-01p-07c-的请求参数然后在controller中进行获取招工信息-->
                                    <!--#httpServletRequest.getRequestURI()是获取去掉localhost的当前路径-->
                                    <!--#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/'))取当前路径/findwork/后面的路径也就是拼接地址-->
                                    <li th:each="workCategorie:${workCategories}">
                                        <!--判断当前路径中是否选中了工种和工种中的详细工作种类，通过判断拼接路径中是否同时含有w和s-->
                                        <!--若工种和工种中的详细工作种类都被选中，比如选了服务业且选了服务业中的临时工/兼职 再次点击选中工种时，会把详细工种排除 01w-05s- 变成 02w- -->
                                        <!--这样就不会导致选中别的工种时，还是显示之前详细工种的内容-->
                                        <a th:if="${#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).contains('w') && #httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).contains('s')}"
                                           th:href="@{'/queryAllEmployeeWork' + ${#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).substring(0, #httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).indexOf('w')-#strings.length(workCategorie.getId()))} +
                                               ${workCategorie.getId()} +
                                               ${#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).substring(#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).indexOf('w'), #httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).length()).replace(#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().indexOf('s')-2, #httpServletRequest.getRequestURI().indexOf('s')+2), '')}}"
                                           th:text="${workCategorie.getKind()}">
                                        </a>
                                        <!--判断当前路径是否只选中了工种而为选中详细工种-->
                                        <!--若判断为true，则只改变工种的编号即可 如 01w- 改为 02w- -->
                                        <a th:if="${#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).contains('w') && !#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).contains('s')}"
                                           th:href="@{'/queryAllEmployeeWork' + ${#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).substring(0, #httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).indexOf('w')-#strings.length(workCategorie.getId()))} +
                                             ${workCategorie.getId()} +
                                             ${#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).substring(#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).indexOf('w'), #httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).length())}}"
                                           th:text="${workCategorie.getKind()}">
                                        </a>
                                        <!--判断当前路径是否选中了工种-->
                                        <!--若判断为true，则直接在当前地址后面添加上该工种的编号即可 如 01p-08c 改为 01p-08c-01w- -->
                                        <a th:if="${!#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).contains('w')}" th:href="@{'/queryAllEmployeeWork' + ${#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/'))} + ${workCategorie.getId() + 'w-'}}" th:text="${workCategorie.getKind()}"></a>
                                    </li>

                                </ul>
                                <!--              细分工作种类-->
                                <ul class="nav nav-pills" th:if="${sonWorkCategories!=null}">
                                    <li class="disabled">
                                        <a href="#">分类</a>
                                    </li>
                                    <li th:each="sonWorkCategorie:${sonWorkCategories}">
                                        <!--判断当前路径是否选中了详细工种-->
                                        <!--若判断为true，则点击其他详细工种时，只改变当前拼接地址中的详细工种编号即可 如01w-05s 改变为 01w-06s -->
                                        <a th:if="${#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).contains('s')}"
                                           th:href="@{'/queryAllEmployeeWork' + ${#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).substring(0, #httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).indexOf('s') - #strings.length(sonWorkCategorie.getId()))} +
                                             ${sonWorkCategorie.getId()} +
                                             ${#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).substring(#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).indexOf('s'), #httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).length())}}"
                                           th:text="${sonWorkCategorie.getKind()}">
                                        </a>
                                        <!--判断当前路径是否没有选中详细工种-->
                                        <!--若判断为true，则当选中详细工种时，只需要在当前拼接地址后面添加该详细工种的编号即可 如01w 改变为 01w-05s -->
                                        <!--下面的地址筛选原理跟工种一样-->
                                        <a th:if="${!#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).contains('s')}"  th:href="@{'/queryAllEmployeeWork' + ${#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/'))} + ${sonWorkCategorie.getId()} + 's-'}" th:text="${sonWorkCategorie.getKind()}"></a>
                                    </li>

                                </ul>
                                <!--              省份-->
                                <ul class="nav nav-pills">
                                    <li class="disabled">
                                        <a href="#">省份</a>
                                    </li>
                                    <li>
                                        <a th:href="@{/queryAllEmployeeWork/}">全国</a>
                                    </li>
                                    <li th:each="region:${regions}">
                                        <a th:if="${#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).contains('p') && #httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).contains('c')}"
                                           th:href="@{'/queryAllEmployeeWork' + ${#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).substring(0, #httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).indexOf('p')-#strings.length(region.getId()))} +
                                               ${region.getId()} +
                                               ${#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).substring(#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).indexOf('p'), #httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).length()).replace(#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().indexOf('c')-2, #httpServletRequest.getRequestURI().indexOf('c')+2), '')}}"
                                           th:text="${region.getPlace()}">
                                        </a>
                                        <a th:if="${#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).contains('p') && !#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).contains('c')}"
                                           th:href="@{'/queryAllEmployeeWork' + ${#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).substring(0, #httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).indexOf('p')-#strings.length(region.getId()))} +
                                               ${region.getId()} +
                                               ${#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).substring(#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).indexOf('p'), #httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).length())}}"
                                           th:text="${region.getPlace()}">
                                        </a>
                                        <a th:if="${!#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).contains('p')}" th:href="@{'/queryAllEmployeeWork' + ${#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/'))}  + ${region.getId() + 'p-'}}" th:text="${region.getPlace()}"></a>
                                    </li>
                                </ul>
                                <!--              城市-->
                                <ul class="nav nav-pills" th:if="${sonRegions!=null}">
                                    <li class="disabled">
                                        <a href="#">城市</a>
                                    </li>
                                    <li th:each="sonRegion:${sonRegions}">
                                        <a th:if="${#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).contains('c')}"
                                           th:href="@{'/queryAllEmployeeWork' +
                                             ${#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).substring(0, #httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).indexOf('c')-#strings.length(sonRegion.getId()))} +
                                             ${sonRegion.getId()} +
                                             ${#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).substring(#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).indexOf('c'), #httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).length())}}"
                                           th:text="${sonRegion.getPlace()}">
                                        </a>
                                        <a th:if="${!#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/')).contains('c')}" th:href="@{'/queryAllEmployeeWork' + ${#httpServletRequest.getRequestURI().substring(#httpServletRequest.getRequestURI().lastIndexOf('/'))} + ${sonRegion.getId()} + 'c-'}" th:text="${sonRegion.getPlace()}"></a>
                                    </li>
                                </ul>

                                <ul class="breadcrumb">
                                    <li>
                                        <a th:href="@{/queryAllEmployeeWork/}">首页</a>
                                    </li>
                                    <li class="active" th:if="${category!=null}" th:text="${category}">
                                    </li>
                                    <li class="active" th:if="${region!=null}" th:text="${region}">
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>


        <div>
            <div class="row">
                <div class="col-md-12" id="worker_box">
                    <div class="media well gongren-work" id="box0" th:each="work:${page.list}" style="background-color: #ffffff; margin-bottom: 5px;margin-top: 5px;">
                        <div class="media-body row">
                            <div class="row">
                                <div class="col-md-1">
                                    <a href="#" class="pull-left"><img th:src="@{'/user/' + ${work.getUser().getUserImg()}}" height="60" width="60" class="media-object" alt='' /></a>
                                </div>
                                <a th:href="@{'/toEmployee/'+${work.getId()}}">

                                <div class="col-md-9" style="padding: 0;">
                                    <h4 class="media-heading">
                                        <b th:text="${work.getUser().getRealName()}"></b></h4>
                                    <span>性别:</span>
                                    <span th:text="${work.getUser().getSex()==0?'男':'女'}"></span>
                                    <span th:text="|年龄:${work.getUser().getAge()} 工种:${work.getExpectedWork()} |"></span>
                                    <span >工作性质:</span>
                                        <span th:if="${work.getWorkNature()==0}">兼职</span>
                                        <span th:if="${work.getWorkNature()==1}">长期工</span>
                                        <span th:if="${work.getWorkNature()==2}">高级工</span>
                                    </span><br>

                                    <div class="media">
                                        <div class="media-body">
                                            <div style="margin-top: 0; padding: 0px;">
                                                <p class="text-defult" th:text="${work.getMyselfDescribe()}"></p>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-md-2" style="padding: 0;">
                                    <a class="btn btn-primary" th:href="@{'/toEmployee/'+${work.getId()}}" role="button" style="float: left; margin-left: 90px;">立刻联系</a>
                                    <div style="float: right; margin-top: 20px; margin-right: 20px;"><img src="/images/ic_local.png" style=" width: 16px;height: 16px;"><span class="small text-primary" th:text="${work.getAddress()}"></span></div>
                                    <div style="float: right; margin-top: 20px; margin-right: 20px;">
                                    </div>
                                </div>
                                </a>
                            </div>
                        </div>
                    </div>
            </div>



            </div>
        </div>

        <div class="ui attached segment" style="display:flex; justify-content:center;">
            <table class="m-mobile-wide" >
                <tbody>
                <tr align="center">
                    <td>
                        <a th:href="@{${#httpServletRequest.getRequestURI()} + '?pageNum=' + ${page.pageNum - 1}}"  class="ui button basic mini" th:unless="${page.isFirstPage}" style="margin-right: 15px">上一页</a>
                    </td>
                    <td>
                        第
                        <h8 th:text="${page.pageNum}">2</h8>
                        页/共
                        <h8 th:text="${page.pages}">4</h8>
                        页
                        共
                        <h8  th:text="${page.total}" >29</h8>
                        条
                    </td>
                    <td> &nbsp;</td>
                    <td style="float: right; margin-left: 15px">
                        <a th:href="@{${#httpServletRequest.getRequestURI()} + '?pageNum=' + ${page.pageNum+1}}" class="ui button basic mini " style="float: right;" th:unless="${page.isLastPage}">下一页</a>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>


        <footer th:insert="common/head :: footer">

        </footer>
    </div>
    <script text="text/script" th:src="@{/js/gongren.js}">
    </script>
</body>

</html>